package com.lyeducation.entities.Files;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.TreeSet;

@Entity
@Table(name = "folder")
public class FolderEntity extends FilesSuperEntity {
  /** */
  private static final long serialVersionUID = -104473403436716687L;

  // // 下级文件夹
  // @OrderBy("C_ID desc")
  // @OneToMany(mappedBy = "folders")
  // private List<FolderEntity> folders;

  // 解决实体onetoMany本身实体的方式
  // @OneToMany(mappedBy = "parent")
  // private List<FolderEntity> children;
  // mappedBy = "parent"找到外键是本类属性为parent=？的所有本实体组为一个集合列表给本children属性



  // 本级文件夹拥有的文件
  private TreeSet<? extends FileEntity> files;

  @Transient
  public TreeSet<? extends FileEntity> getFiles() {
    return files;
  }

  public void setFiles(TreeSet<? extends FileEntity> files) {
    this.files = files;
  }

  public static long getSerialVersionUID() {
    return serialVersionUID;
  }


  // /**
  // * 子目录的数量
  // */
  // @Column(name = "C_SIZE")
  // private int size;

  // /**
  // * 目录下的文件数量
  // */
  // @Column(name = "C_COUNT")
  // private int count;

}
